Methods for dynamic bandwidth allocation and queue management in ethernet passive optical networks

ABSTRACT

In a passive optical network, dynamic bandwidth allocation and queue management methods and algorithms, designed to avoid fragmentation loss, guarantee that a length of a grant issued by an OLT will match precisely the count of bytes to be transmitted by an ONU. The methods include determining an ONU uplink transmission egress order based on a three-stage test, and various embodiments of methods for ONU report threshold setting.

CROSS REFERENCE TO EXISTING APPLICATIONS

This is a Continuation of U.S. patent application Ser. No. 10/525,505,which was filed Feb. 25, 2005, as national phase of PCT/IL2003/000702,filed Aug. 26, 2003, which claims priority from U.S. Provisional PatentApplication No. 60/410,317 filed Sep. 13, 2002, and from U.S.Provisional Patent Application No. 60/410,170 filed Sep. 25, 2002, allof which are incorporated herein by reference.

FIELD OF THE INVENTION

The present invention relates generally to data access methods, and moreparticularly, to methods for optimizing data transmission in Ethernetpacket traffic over Passive Optical Network (PON) topologies.

BACKGROUND OF THE INVENTION

The Ethernet PON (EPON) is using 1 gigabit per second Ethernettransport, which is suitable to very high-speed data applications, aswell as to converged system support (telephone, video, etc.). Theunprecedented amount of bandwidth is directed toward, and arriving froma single entity, the Optical Network Unit (ONU).

An EPON network can be viewed as a distributed switch. An Optical LineTerminal (OLT) manages remotely the transmission of each ONU. The OLTand the ONUs exchange messages. In each cycle of such an exchange, theOLT grants a grant to each ONU, which is answered by a report messagefrom the ONU. The ONU has a queue manager that prepares queue statusinformation, which is transmitted using MPCP messages to the OLT toenable smart management. In other words, the ONU “informs its internalqueues status” to the OLT. The OLT management is executed using aDynamic Bandwidth Allocation (DBA) algorithm. An efficient algorithm isessential to guarantee Quality of Service (QoS), required to fulfill aService Level Agreement (SLA). Operator revenues will increase fromselling sophisticated SLAs to customers. High bandwidth utilizationallows adding more customers to the network. Thus, a queue manager in anONU is an enabler for any DBA algorithm executed by the OLT.

One of the key causes for low bandwidth utilization is the packetfragmentation loss. A fragmentation loss occurs when a grant does notmatch precisely the amount of bytes to be transmitted by the ONU. An ONUis not allowed to fragment packets, causing the remaining portion of agrant to be wasted. FIG. 1 shows a grant with a grant length 102. If forexample three packets, marked #1, #2, and #3, are to be included in thegrant, packets, #1 and #2 will fit, while packet #3 will not. There willbe a fragmentation loss 104 given by the grant length minus the sum (inbytes) of the packets transmitted.

FIG. 2 shows a prior art EPON system comprising an OLT 200 and aplurality of ONUs 202. The OLT and the ONUs exchange messages. In eachcycle of such an exchange, the OLT grants a grant G to each ONU, whichis answered by a report message REP from the ONU to the OLT. Forexample, the reporting by the ONU to a grant received in a cycle N−1 ata grant message time t_(G)(N−1) occurs at a report message transmissiontime t_(R)(N−1). Regardless of the particular algorithm be used todifferentiate between ONUs, the basic granting scheme is identical. AnONU must have a deterministic behavior in the time period between reportmessage transmission and grant message reception, i.e.t_(G)(N−1)−t_(R)(N−1). The information of the OLT is updated only up tot_(R)(N−1). The transmission order depends on packet priority, which canbe any arbitrary value (e.g. 0.7 in EPON). In this case, 0.7 means thatthere are 8 priorities, numbered from 0 to 7, with 0 being the lowestand 7 being the highest. Whenever a packet of a higher priority existsin the queue, it will be transmitted before any packet of a lowerpriority.

The ONU reports the total number of bytes (“total bytes”) existing inany of the sub-queues. The IEEE802.3 standard allows reportingadditional information per sub-queue, the additional information basedon defining a programmable threshold per sub-queue. The threshold is setby the OLT using a proprietary message. For example, in a sub-queue with5 packages of priority 0.5, the threshold in bytes may be 1600, 4000,3000, 3000, 4000 and 2000, respectively. The ONU reports the totalnumber of bytes below the programmable threshold. In the example above,this number could be 1500, 0, 2800, 0, 3900 and 1500, and it is a resultof the actual queue occupancy. Utilizing this information will help toreduce the grant size, which can be used for finer granting.

FIG. 3 shows a flow chart of the steps in the reception of a packet to aqueue by the ONU, as occurring in prior art systems. The packet iswritten in step 300, and the priority of the packet is extracted in step302. The length of the new packet is added to the content (“totalbytes”) of the appropriate (same priority) packet sub-queue in step 304,to yield a new “total bytes” value. If the combined value of “bytesbelow threshold” and packet length is still smaller than the thresholdof the sub-queue, the value of the “bytes below threshold” of theparticular sub-queue is incremented with the packet length in step 306.Else, the value of the “bytes below threshold” remains unchanged. Forexample, a packet with a length of X bytes is added to the relevantsub-queue that has a threshold T and a value of “bytes below threshold”M. If X+M<T, M=M+X. Else, M remains unchanged.

The methods used in prior art result in packet fragmentation losses andtherefore low bandwidth utilization. It is thus desirable to provide anew set of efficient management methods and algorithms that willeliminate packet fragmentation losses, enable efficient full bandwidthutilization and guarantee QoS.

SUMMARY OF THE INVENTION

The present invention discloses various embodiments of dynamic bandwidthallocation methods and algorithms, designed to avoid fragmentation loss.Their main innovative aspect is guaranteeing that a length of a grantissued by an OLT will match precisely the count of bytes to betransmitted by an ONU. The present invention provides, in variousembodiments, methods for determining an ONU uplink transmission egressorder (also referred to as “ONU egress order”), and of an ONU reportthreshold setting (also referred to as “threshold setting”). Existingqueue management algorithms such as “Strict priority”, “Fair queuing”and their derivations, are not suitable for distributed switchmanagement, as they do not consider EPON protocol events, such as thetime a “Report” message was transmitted. In contrast, the queuemanagement methods and algorithms disclosed herein takes intoconsideration EPON protocol events, such as queue occupancy at a“Report” message preparation time, and at a “Grant” message handlingtime.

According to the present invention, there is provided in a passiveoptical network a method for transmitting packets by an ONU comprisingthe steps of receiving a grant having a grant length from an OLT, andbased on the grant, calculating an ONU packet egress order thateliminates packet fragmentation.

According to the present invention, there is provided in a passiveoptical network a method for eliminating packet fragmentation comprisingthe steps of providing an OLT connected to a plurality of ONUs, each ofthe ONUs transmitting packets arranged in sub-queues having a total bytelength, the packets transmitted in response to a grant having a grantlength and received from the OLT, and matching the total byte lengthwith the grant length, whereby the fragmentation loss is eliminated.

According to the present invention, there is provided a method forsetting a threshold for dynamic bandwidth allocation in a passiveoptical network that includes an OLT and a plurality of ONUs, the methodcomprising the steps of providing a weighted fair queuing configurationto the OLT, and providing a threshold used in combination with theweighted fair queuing configuration while granting a grant with adesired grant length to an ONU.

According to the present invention, there is provided a method forsetting a threshold in a passive optical network that includes an OLTand a plurality of ONUs, the OLT granting grants to the ONUs, which inturn transmit packages arranged in sub-queues in response to the grants,the method comprising the steps of performing a comparison betweenONU-reported parameters and a desired grant length, and adjusting athreshold based on the results of the comparison, thereby providing atarget bandwidth adaptation mechanism in which the threshold value ofall sub-queues is identical.

According to the present invention, there is provided a method forsetting a threshold in a passive optical network that includes an OLTand a plurality of ONUs, the OLT granting periodically a grant having agrant length to each ONU, the ONU transmitting packages arranged insub-queues in response to the grant, the method comprising the steps ofproviding a plurality of priorities, each associated with a sub-queue ofpackages, each priority having a unique priority threshold, andadjusting each priority threshold such that a sum of all the adjustedpriority thresholds has a fixed value.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention is herein described, by way of example only, withreference to the accompanying drawings, wherein:

FIG. 1 shows schematically an example of fragmentation loss;

FIG. 2 shows schematically a prior art method for controlling messagesflow between an OLT and an ONU;

FIG. 3 is a flow chart of packet reception by an ONU;

FIG. 4 shows a flow chart of the steps in the report preparation andstorage by an ONU;

FIG. 5 shows a preferred embodiment of the method for determining an ONUuplink transmission egress order according to the present invention;

FIG. 6 is an example of a queue egress process;

FIG. 7 is a diagram showing the timing relation between queue ingressand egress processes;

FIG. 8 shows an implementation of WFQ using threshold setting accordingto the present invention;

FIG. 9 shows a flow chart of the steps of a threshold setting methodusing the TABA mechanism according to the present invention;

FIG. 10 shows a flow chart of the steps of a threshold setting methodusing the PTM mechanism. according to the present invention;

FIG. 11 is a flow chart of a desired grant length calculation;

DESCRIPTION OF THE PREFERRED EMBODIMENTS

The present invention provides, in various embodiments, methods fordetermining an ONU egress order, and of an ONU threshold setting. Theseembodiments are now described in detail below.

ONU Egress Order

The key feature for avoiding fragmentation loss is the OLT's ability tocontrol the transmission order of packets transmitted by an ONU. Thesystem and algorithm of FIG. 2 do not avoid fragmentation loss becausethey use a single test of a stage variable, as opposed to a three-testprocedure in the method of the present invention described below. Anyupdate in the status of a queue (i.e. the list of packets with theirlengths and their transmission order, which is a function of priority)at a specific time must be hidden from the OLT. According to the presentinvention, in order to hide the packet transmission events, an ONUperforms a pre-calculation of packet transmission order for an upcominggrant. When the grant message arrives, the ONU calculates the order ofpackets supposed to be transmitted, and marks these packets as “about tobe transmitted”. If more grants arrive, the ONU will ignore the markedpackets as if they were already transmitted, although, in practice,those packets are still in a transmission queue, waiting for theirupcoming transmission. The transmission queue is comprises sub-queues,each including packets of the same priority.

In order to hide packet reception events, an ONU must freeze (i.e. lockthe transmission order of) its queues. A packet received from a userport will not be transmitted, unless the ONU pre-calculation marks thepacket as “about to be transmitted” in the start time specified in thegrant message.

FIG. 4 shows a flow chart of the steps in the report preparation andstorage by an ONU. In a report preparation step 400, the current valuesof “total bytes” and of “bytes below threshold” of each sub-queue areembedded inside the report message. These parameters are stored in step402 in two storage array variables: a stored array value of “totalbytes”, and a stored array value of “bytes below threshold”, both beingused in the method for determining the ONU transmission egress orderbelow.

FIG. 5 shows in a flow chart a preferred embodiment of the method fordetermining an ONU uplink transmission egress order according to thepresent invention. The description refers to one cycle in a series ofcycles that represent continuous operation of grants. Each cycle sees agrant being granted by the OLT. A new grant sent by the OLT is handledby the ONU in step 500. A “remaining grant length” (i.e. a variablestoring the available space (in bytes) left in a grant to be filled) isloaded with the grant length value arriving with the grant in thepresent cycle. Any messages handled via special queues, such as reportmessages in a Multi-Point Control Protocol (MPCP), are first decreasedfrom the remaining grant length in step 502. The method includes anumber of actions run in preferably three “stages”, each such stageinvolving a series of actions performed on a “stage variable”. The threestage variables, each tested or “acted upon” in each cycle are(preferably in this order): “reported bytes below threshold”, “reportedtotal bytes”, and “total bytes”. Each stage variable is treatedseparately, starting with a stage that treats “reported bytes belowthreshold”, which undergoes processing according to steps 504 to(potentially) 518, the second stage repeating the process with “reportedtotal bytes”, and the third stage repeating the process with “totalbytes”.

In the first stage, the stage variable value is initialized to “reportedbytes below threshold” in step 504. The highest priority sub-queuestarts to be handled in step 506. “Handling” in this context indicatesacting upon or treating only this sub-queue. In step 508, the sub-queueis checked to see if it includes ungranted packets, i.e. if there is atleast one packet that has not been granted yet, and which can bepotentially transmitted. If there is no such packet, the executioncontinues from step 518. If there is such a packet, its length iscompared with the remaining grant length in step 510. If the ungrantedpacket fits inside the grant (i.e. the grant length is bigger than theungranted packet length) a “stage condition” (explained below) ischecked in step 512. If the ungranted packet does not fit inside thegrant, execution continues in step 518. The type of check run for thestage condition in step 512 depends on the chosen stage variable. If thestage variable used is “reported bytes below threshold”, its value iscompared to 0. Similarly, if the stage variable used is “reported totalbytes”, its value is compared with 0, and if the stage variable used is“total bytes”, its value is compared with 0. In other words, theexecution moves to, and continues from, step 518 in each of thefollowing cases: the result of the comparison in step 512 is 0, afailure occurs in step 510 (i.e. an ungranted packet has a length toolong for the grant), or a failure occurs in step 508 (i.e. there are noungranted packets in sub-queue). If the stage condition checked in step512 succeeds, meaning the value of the compared stage variable isgreater than 0, execution continues from step 514. In this step, thepacket is marked as “granted”, (i.e. is no longer considered asungranted). In the following step 516, the “granted” packet length issubtracted from all variables, namely from the remaining grant length,from “reported bytes below threshold”, from “reported total bytes”, from“reported bytes below threshold”, and from “total bytes”. However, ifthe value of one these variables is 0, the “granted” packet length isnot subtracted from it. The execution then returns to step 508, wherethe sub-queue is investigated again, for a next packet.

If any of the comparison checks in steps 508, 510 or 512 results in theexecution being sent to step 518, in step 518, the priority of thepresently handled queue is compared with the lowest priority. If thepriority of the presently handled sub-queue is not the lowest priority,then in step 520 the priority of the presently handled sub-queue isdecreased by 1, to enable handling of the next priority sub-queue. Theexecution returns to step 508, where the new sub-queue starts to undergothe same sequence of steps as above. If the priority of the presentlyhandled sub-queue in step 518 is the lowest, execution continues fromstep 522. In step 522, the stage variable is checked to see if it is setto “total bytes”. If yes (stage variable is “total bytes”) the operationis completed, and the execution returns to step 500, to wait for thenext grant. If no (stage variable is set to one of the other twopossibilities), the execution continues to step 524, in which the stagevariable is updated. That is, if the just processed stage variable was“reported bytes under threshold”, the variable is now updated (set) tobe “reported total bytes”, and if it was “reported total bytes” it isset to “total bytes”. The execution continues from step 506, where othersub-queues start to be examined again from highest to lowest priority.

In summary, the method includes running, for each sub-queue, a series oftests in preferably three stages. Each stage includes a check of a stagevariable value against a set value (zero). Based on the result of thecheck, a previously ungranted packet is either “marked as granted” andshunted aside, or left in the sub-queue, the process being replayed withthe next highest priority sub-queue. In contrast with prior art methodsthat employ only one (instead of three) tests, the method embodied bythe flow chart in FIG. 5 guarantees a perfect match (eliminates packetfragmentation) between the OLT granting decision, which is based on itslatest knowledge, and the ONU egress order. It allows a flexible OLTgrant length selection, which can be any combination of values of “bytesbelow threshold” and “total bytes” values. The single constraint is thatthese values must be accumulated from highest to lowest priority, andthat all “bytes below threshold” must be accumulated before adding“total bytes” to grant length. Prior art methods include the equivalentof only one stage (and test) of the present method, that of “totalbytes”. In other words, prior art methods run only one of the three“stages” disclosed herein, thus being much less efficient in eliminatingpacket fragmentation. Dividing the operation into such “stages” allowsthe OLT to have flexibility in calculating the grant length, asdescribed above. The major inventive feature of the method appears instep 514, in which packets are “marked” as “granted”, even though theyare still in the sub-queue, while additional calculations are thenperformed as if these “marked as granted” packets were transmitted. Step522 is the one responsible for the decision to continue to the nextcycle.

FIG. 6 shows an example of a queue egress process according to thepresent invention, in the case in which the OLT grant length preciselymatches the sum of packets length below threshold for all sub-queues. In(a), packets P1-P14 display an initial queue occupancy: P1 indicates afirst packet transmitted, P2 indicates a second packet transmitted, andso on. For simplicity, only 3 sub-queues marked “0”, “1” and “2” aredisplayed, and all thresholds of the sub-queues are identical, andmarked as Threshold 640. The OLT transmits a grant that has a lengthequal to the sum of the reported bytes below threshold, i.e.(P1+P2)+P3+(P4+P5+P6). The grant is sufficient to include all thepackets below the threshold. These packets are stored in a separatedstorage 650, shown at the bottom in (c). They are the next packets to betransmitted, and will not be included in future reports. Packets P7-P14in FIG. 6( b) are the only packets considered in the current queuestatus, and the only packets that will be reported. The queue status isupdated as if packets P1 to P6 were transmitted. It is clear that it isnot necessary to physically copy the packet(s) to separate storage 650,as one could use pointer management manipulations for that purpose.

FIG. 7 shows an example of the timing relation between a queue egressprocess and an ingress process, as occurring using the method describedherein. The top (a) section shows a queue ingress timeline T with items(packets) marked I1-I13 from left to right. The bottom (b) section showspackets arranged by priority in three sub-queues “0”, “1” and “2”.Inside each item, there are two numbers: a bottom one starting with Iand marking the ingress order, and a top one marking the egress order.Box I9 marks the event of packet reception. There are two major eventson the ingress timeline: the first, item 700 (which coincides with thepacket reception in box I9) is the preparation of a report message,which is done just before the next transmission requiring report. Thesecond event, item 702, is the reception of a grant by an ONU. PacketsI1-I8 were received before the report was prepared in item 700, andpackets I9-I12 were received before the grant was handled in item 702.Item 710 marks the packets existing in sub-queue #0 when the report wasprepared, while items 711 and 712 mark the same for sub-queues #1 and #2respectively. Item 720 marks the packets existing in sub-queue #0 whenthe grant was received.

As can be seen, a higher priority packet will be selected fortransmission before a lower priority packet even if the lower prioritypacket arrived earlier. For example, the third packet received, i.e.item I3, will be transmitted after the fourth packet received, i.e. itemI4. In another example, I1, the first packet received, will betransmitted after I6, the sixth packet received. Item I9, whichidentifies the ninth packet received, is still below threshold (i.e. ithas priority over packets above threshold) but since it was receivedafter the report was prepared, it will be transmitted after the twelfthpacket received (item I12), because the information by the algorithm isthe status of packets below threshold at the report preparation moment.Item I13, which identifies the thirteenth packet received will not betransmitted at all in the next grant, as it was received after the grantwas handled.

Threshold Setting

In the dynamic bandwidth allocation methods and algorithms of thepresent invention, the values of the thresholds greatly affect the orderin which packets will be granted, the balance between differentpriorities, and the possible granularity for grant length selection. Thelast item is a result of an OLT decision, which, in order to avoidfragmentation error, may take for grant length calculation either thevalue of “bytes below threshold” or of “total bytes”. As the spanbetween these two values is potentially large, setting the thresholdcorrectly is important when targeting an allowed bandwidth for a user.The present invention discloses three different embodiments of thresholdsetting methods.

In a first embodiment of a threshold setting method according to thepresent invention there is provided a mechanism that adjusts dynamicallythe thresholds, using an improvement on a prior art mechanism. Thismechanism is called Weighted Fair Queuing (WFQ) and is adapted herein toa distributed switching architecture, as the ONU is remotely controlledby the OLT. The “adaptation” includes enhancing the WFQ algorithm byintroducing a threshold concept inside it. The WFQ method and itsderivatives are based on ordering the traffic in classes(“classification”. The classification process is well known in the art,Each class receives a constant share of the bandwidth. For example,class 1 has 40%, class 2 has 30%, class 3 has 10%, and class 4 has 20%of the bandwidth. This guarantees deterministic and fair bandwidthcontrol. In order to support WFQ, an ONU must support classification.Flows based on packet parameters are directed to specific classes.

FIG. 8 shows an implementation of WFQ using threshold setting accordingto the present invention. The implementation is described as a flowdiagram, and effected using a state machine. For support of multipleONUs, the OLT should create multiple instances of this state machine,one per each ONU. FIG. 8 a shows the operating environment. In step 800,the OLT receives a report message from an ONU. In step 802, the OLT setsa grant length to the value of the sum of “bytes below threshold” asreported by all queues. In step 804, the OLT transmits the grant messagetoward the ONU.

FIG. 8 b shows the innovative adaptation of WFQ with thresholdsaccording to the present invention (i.e. the way the OLT determines thethreshold for transmission). In step 850, the OLT receives a WFQconfiguration, in the form of the ratios of each sub-queue priority.Packets from a certain class are stored inside a specific sub-queue,i.e. a class ratio is the sub-queue ratio. The desired grant length isreceived as well from a management system, responsible for subscriberagreements (not shown). In step 852, variables for each sub-queue,storing the number of bytes metered (counted) during ONU transmissions,are initialized to 0. In step 854, the OLT calculates the threshold foreach sub-queue, using preferably the following scheme: the desired grantlength is multiplied by the sub-queue (class) ratio and furthermultiplied by a calibration factor, typically equal to 1.25, and theproduct is sent as a threshold to the sub-queue. For example, if thedesired grant length is 8000 bytes, if the class ratios are 0.3, 0.4,0.2, 0.1, and if the calibration factor is 1.25, the thresholds arerespectively 3000 (8000×0.3×1.25), 4000, 2000, and 1000. Evidently, theconstant shown here are exemplary only, and other constants can beselected. The OLT then transmits a message containing the thresholds ofall sub-queues to the ONU in step 856.

The following steps are optional, and are required only if an adaptivemechanism is desired. In step 858, the OLT counts the number of bytestransmitted from each sub-queue. In step 860, the OLT adds the countedvalue to the value stored in a total counted variable. In step 862, theOLT checks if the ratios between the counted values of the sub-queuesand expected values (calculated by summing all the counted bytes of allsub-queues, and then multiplying the sum with the configured ratio persub-class) differ significantly, for example by a 10% relativedifference or a 5% absolute difference. These differences may resultfrom a variance in packet length between sub-queues. If no difference isfound, the OLT returns to monitor the number of bytes transmitted instep 858. If a difference is found, the OLT adjusts the thresholds instep 864. The adjustment can be done in many ways, for example byincreasing the threshold for the deprived sub-queues (meaning thosequeues whose percentage of transmitted bytes relative to the sum oftransmitted bytes of all sub-queues is less than configured), and bydecreasing the threshold for the advantaged sub-queues (meaning thosequeues whose percentage of transmitted bytes relative to totaltransmitted bytes is more than configured). After adjustment, the OLTreturns to step 856 to transmit the message.

The key step is 854, in which the threshold per sub-queue is calculatedbased on WFQ ratios. In contrast with standard WFQ algorithms, whichbase the packet selection on mechanisms that measure transmitted rate,in the improved WFQ method of the present invention includes twoinnovative features: a packet selection based on setting a threshold,which defines a rule for status report, and the use of the ONU propertyto transmit first the all packets below threshold, which allows easymaintenance of the ratio between priorities, without optional periodicadjustments.

In a second embodiment of a threshold setting method according to thepresent invention, there is provided a mechanism that adjustsdynamically the thresholds to predict the reported bytes belowthreshold. This mechanism is named Target Bandwidth Adaptation (TABA).The goal is to match a grant length as closely as possible to a desiredlength. The mechanism sets all threshold values of all sub-queues to beidentical. That is, all priorities have the same threshold. The mainconcept is to increase the threshold values when the sum of reportedbytes below threshold of all priorities is too low, and to decrease thethreshold values when the sum of reported bytes below threshold of highpriority queues is too high. The concept is illustrated in FIG. 9

FIG. 9 shows a flow chart of the steps of a threshold setting methodusing the TABA mechanism. The flow chart shows the handling of one ONUby an OLT related state machine. As with the WFQ embodiment of FIG. 8,for support of multiple ONUs, the OLT should create multiple instancesof this state machine, one per each ONU. In step 900, the OLT sets aninitial value of a threshold (which is identical for all sub-queues),typically to (1.5/number of priorities)*desired grant length. The numberof priorities is the number of sub-queues in a queue and the number ofpacket classes. In step 902, the OLT transmits the threshold valuetoward the specific ONU. In step 904, the OLT receives a report from thespecific ONU. In step 906, the OLT compares the sum of the values of“total bytes” reported in step 904 to the desired grant length. If thesum is smaller than the desired grant length, the operation returns tostep 904, as no adjustment can be done to the threshold, since the ONUdoes not have enough data to adjust according to. In other words, theONU traffic is too low, and not enough to fill the desired grant length,regardless of any effort made to adjust the threshold. If the sum isequal or larger than the desired length, operation continues from step908. In this step, the OLT compares the sum the values of reported bytesbelow threshold with the desired grant length. If the sum is larger thanthe desired length, the operation continues from step 914. If the sum issmaller than the desired length, the operation continues from step 910.In step 910, the thresholds (all equal to one value) are increased by anarbitrary function, for example by multiplication with a constant or byaddition of a constant. The execution then goes to step 912, in which anew message that updates the threshold value is transmitted, and theexecution returns to step 904. In step 914, the OLT sums the values ofreported bytes below threshold from the highest priority to aconfigurable priority to obtain a “high-priority” sum. Typically, theconfigurable priority will be 50% of the highest priority, rounded up.The high priority sum is then compared with the desired grant length instep 916. If the high priority sum is smaller than the desired length,the execution returns to step 904. Otherwise, execution continues fromstep 918, where the thresholds are decreased by an arbitrary function,for example by division with a constant or by subtraction of a constant,following which the execution goes to step 912.

The key steps are 908 and 916 that compare the desired grant length withinformation arriving in a report message. The comparisons allow theadaptation of the threshold to predict the grant to be as close aspossible to a desired value.

For example, assume that the desired grant length is 10000, and thenumber of priorities is 4. The initial threshold value is(1.5/4)*10000=3750. For simplicity, assume that the reported number of“total bytes” and bytes below threshold of all priorities is identical.Assume that in the first cycle, the reported value of “total bytes” is2000 per priority. As this value is smaller than the threshold, it willbe reported as the amount of “bytes below threshold”. Since the sum ofthe “total bytes” is 8000, i.e. smaller than the desired grant length of10000 (as checked in step 906), no adjustment is done. Assume that inthe second cycle, the reported value for “total bytes” is 5000. Thebytes below threshold reported value is 2000 (since it must be smallerthan the threshold which is 3750), As the sum of bytes below thresholdis smaller than the desired grant length (10000), the threshold shouldbe increased. In this example, the threshold is increased by 20% to4500, and a threshold update command is transmitted to this ONU. Assumethat in the third cycle, the reported value of “total bytes” is again5000, and the reported value of bytes below threshold is 3000. The sumof bytes below threshold is now 12000, hence the threshold should not beincreased. The sum of “bytes below threshold” of the highest priorities(which was assumed here to be the group of the two highest priorities),i.e. the “high-priority” sum defined above is 6000, hence the thresholdshould also not be decreased. In other words, after the third cycle, thethreshold is left unchanged, and the cycles end.

In a third embodiment of a threshold setting method according to thepresent invention there is provided yet another mechanism that adjustsdynamically the thresholds to predict as close as possible the trafficpartition between priorities. This mechanism is named Priority TrafficMonitor (PTM). As opposed to the previous (TABA) method, each priorityhas in this case a unique threshold value, based on the amount of dataarriving from the priority. The main concept is to set the sum of allthresholds to a fixed value, typically larger than the length of adesired grant. The threshold values are adjusted based on actual “bytesbelow threshold” reported per sub-queue associated with a priority.

FIG. 10 shows a flow chart of the steps of a threshold setting methodusing the PTM mechanism. The flow chart shows handling of one ONU by anOLT related state machine. As in the two previous (WFQ and TABA)methods, the PTM method may be used with a plurality of ONUs, byproviding multiple instances of the state machine. Steps 1000-1004 areessentially similar to steps 900-904 in FIG. 9. In step 1000, the OLTsets the initial value of each threshold, typically to (1.5/number ofpriorities*desired grant length). In step 1002, the OLT transmits thethreshold value toward the specific ONU. In step 1004, the OLT waitsuntil a report message is received from the specific ONU. In step 1006,a loop defined by a loop index is run over all priorities. When the loopends, the execution returns to step 1002. As long as the loop runs, step1008 is comparing the reported value of bytes below threshold for thecurrent sub-queue associated with a priority loop variable with theexpected threshold for the same sub-queue. That is, the loop index marksthe presently examined sub-queue. If the value of reported bytes belowthreshold is too big, meaning the reported value is larger than apredefined portion of the threshold, for example 2/3, the execution goesto step 1010 in which the threshold of the sub-queue associated with theloop variable priority is increased by a constant value, while the otherthresholds of the other sub-queues are decreased by the same constantdivided by (number of priorities −1). For example, if the reported valueof bytes below threshold is 5000 and the expected threshold is 6000,then the threshold for this priority will be incremented, based on the2/3 ratio for this example. Assuming there are 4 priorities, and thevalue added is 600, then following this step the threshold for thispriority will be 6600, while all the other thresholds of all otherpriorities will be subtracted by 200. Afterwards, the execution returnsto the loop to step 1006. If the value is too small, meaning thereported value is smaller than a predefined portion of the threshold,for example 1/3, the execution goes to step 1012 in which the thresholdof the sub-queue associated with the loop variable priority is J5decreased by a constant value, while the other thresholds of the othersub-queues are increased by the same constant divided by (number ofpriorities −1). Afterwards, the execution returns to the loop to step1006. If the value is neither too big nor too small, meaning it islocated between the high and low thresholds, no adjustment is required,and the execution returns to the loop in step 1006. Steps 1010 and 1012are aimed at maintaining the sum of all thresholds constant.

The key step is 1008, which enables investigation of each sub-queue interms of reported values vs. threshold values, to determine how toadjust the threshold, which is either increased, decreased, or leftunchanged.

For example, assume that the desired grant length is 10000, the numberof priorities is 4, and the update constant is 450. The initialthreshold value is (1.5/4)*10000=3750. Assume that in the first cyclethe reported “bytes below threshold” is 3000 for all priorities. Theloop begins running on each priority. For each given priority, the valueof the threshold should be increased, while other priority thresholdsshould be decreased. For example, the value of the first prioritythreshold is increased by 450, and that of all other priority thresholdsare decreased by 450/3. After the first loop execution the thresholdswill accordingly be 4200, 3600, 3600 and 3600. After the secondexecution the thresholds will be 4050, 4050, 3450, 3450. After the thirdexecution the values will be 3900, 3900, 3900, 3300, and at the end thevalues will be 3750 for all priorities. As seen, the original values ofall thresholds are still valid, since all the reported “bytes belowthreshold” were equal. Assume that in the second cycle, the reportedbytes below threshold were 3000, 2000, 2000 and 1000 respectively. Afterthe first loop execution, the threshold values will be (as in the firstloop of the first cycle) 4200, 3600, 3600 and 3600. The second and thirdexecution will not modify the values, since the value of “bytes belowthreshold” is bigger than the condition to decrease (1/3 of threshold),and smaller than the condition to increase (2/3 of threshold). In thelast execution, the value of “bytes below threshold” is smaller than 1/3of the threshold, requiring a decrease in the threshold value for thispriority, and an increase in the threshold value of other priorities.After the last execution, the threshold values will be 4350, 3750, 3750,3150.

For the sake of completeness, FIG. 11 presents two examples fordetermining the desired grant length. The right side mechanism (steps1100-1102) is based on adjusting the desired grant length to minimumbandwidth, and the left side mechanism (steps 1150-1156) is based onadjusting the sum of all ONU desired grant lengths to cycle length. Thatis, we take all desired grant lengths of all ONUs, sum them, and adjustthem to cycle length. A “cycle length” is the number of bytes granted ata single OLT granting decision, covering all ONUs.

Beginning with the right side mechanism, in step 1100, a new or updatedminimum bandwidth (MIN BW) requirement arrives from a management systemresponsible for customers Service Agreement Level for one of the ONUs.In step 1102, the MIN BW value is used to calculate the desired grantlength, which should be equal to (MIN BW/available BW)*cycle length.

The left side mechanism begins in step 1150, in which the OLT receives anew or updated “fairness parameter” requirement for one or more ONUs.There are many possible representations of a fairness parameter. Forexample, bandwidth may be divided linearly between ONUs based on thefairness parameter. In step 1152, the sum of all fairness parameters(one per ONU) is calculated. In step 1154, a loop is executed, runningover all ONUs. In step 1156, the desired grant length is calculated forthe loop index (step 1156 is executed for each loop cycle) by,preferably using the formula: grant length=(ONU fairness parameter/sumof fairness parameters)*cycle length

All publications and patents mentioned in this specification are hereinincorporated in their entirety by reference into the specification, tothe same extent as if each individual publication or patent wasspecifically and individually indicated to be incorporated herein byreference. In addition, citation or identification of any reference inthis application shall not be construed as an admission that suchreference is available as prior art to the present invention.

While the invention has been described with respect to a limited numberof embodiments, it will be appreciated that many variations,modifications and other applications of the invention may be made. Whathas been described above is merely illustrative of the application ofthe principles of the present invention. Those skilled in the art canimplement other arrangements and methods without departing from thespirit and scope of the present invention.

1. A method for transmitting packets by an optical network unit (ONU) ina passive optical network (PON), comprising the steps of: a) receiving agrant having a grant length from an optical line terminal (OLT) of thePON; b) calculating an ONU packet egress order based on the grantlength; and c) fitting exactly the grant length using the calculated ONUpacket egress order, thereby eliminating packet fragmentation.
 2. Themethod of claim 1, wherein the step of calculating is preceded by a stepof handling out of band information, and includes handling a sub-queueof a given priority.
 3. The method of claim 2, wherein the handlingincludes checking the sub-queue for ungranted packets, and wherein thestep of calculating includes performing a three-stage test on each ofthe ungranted packets, each of the stage tests involving a stagevariable.
 4. The method of claim 3, wherein the stage variable isselected from the group consisting of reported bytes below threshold,reported total bytes, and total bytes, and wherein the performing of astage test involving a stage variable includes comparing a value of thestage variable to zero.
 5. The method of claim 4, wherein the ungrantedpacket is marked as granted if the result of the comparison is that thevalue of the stage variable is greater than zero.
 6. The method of claim1, wherein the grant is a flexible grant set by the OLT based oninformation received from the ONU.
 7. The method of claim 6, wherein theinformation includes a combination of values of bytes below thresholdand values of total bytes.
 8. The method of claim 7, wherein thethreshold is adaptive.
 9. The method of claim 7, wherein the values ofbytes below threshold and the values of total bytes are accumulated fromhighest to lowest priority.